import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';

class RainCell extends StatelessWidget {
  final String title;
  final String des;
  final Function onChanged;
  final Function click;
  final bool enabled;
  final TextEditingController controller;

  RainCell(
      {this.title,
      this.des,
      this.controller,
      this.onChanged,
      this.click,
      this.enabled});

  @override
  Widget build(BuildContext context) {
    return Container(
      margin: EdgeInsets.only(bottom: ScreenUtil().setWidth(10.0)),
      child: InkWell(
        child: TextField(
            style: TextStyle(
                fontSize: ScreenUtil().setSp(32.0), color: Colors.black38),
            //输入文本的样式
            enabled: enabled == null,
            decoration: InputDecoration(
              icon: Container(
                width: ScreenUtil().setWidth(170.0),
                child: Text(title),
              ),
              hintText: des,

              border: InputBorder.none,
              suffixIcon:
                  enabled != null ? Icon(Icons.keyboard_arrow_right) : null,
            ),
            onChanged: onChanged,

            controller: controller),
        onTap: click,

      ),
      decoration: BoxDecoration(
        border: Border(
          bottom: BorderSide(width: 1, color: Color(0xffe5e5e5)),
        ),
      ),
    );
  }
}
